#Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=libxvmc
pkgver=1.0.13
pkgrel=2
pkgdesc="X11 Video Motion Compensation extension library"
arch=('x86_64')
url="https://xorg.freedesktop.org/"
license=('custom')
depends=('libxext' 'libxv')
makedepends=('meson')
source=(${url}/releases/individual/lib/libXvMC-${pkgver}.tar.xz{,.sig})
sha512sums=('c9d0f73884a586efb9ea4f77fc8555f60d940077d7dff8eaa765b86345c8b4e3d80b860f68191d2830c272b9e464c08450fbb51bb64819753a6f4228c71861ac'
            'SKIP')
#validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') #  Alan Coopersmith <alan.coopersmith@oracle.com>
#validpgpkeys+=('C41C985FDCF1E5364576638B687393EE37D128F8') # Matthieu Herrb <matthieu.herrb@laas.fr>
#validpgpkeys+=('995ED5C8A6138EB0961F18474C09DD83CAAA50B2') # "Adam Jackson <ajax@nwnk.net>"
validpgpkeys=('3BB639E56F861FA2E86505690FDD682D974CA72A') # Matt Turner <mattst88@gmail.com>

build() {
 arch-meson libXvMC-${pkgver} build
 # Print config
 meson configure build
 meson compile -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build

  # fix doc dir with meson
  install -m755 -d "${pkgdir}"/usr/share/doc/libXvMC
  mv "${pkgdir}"/usr/share/doc/XvMC_API.txt "${pkgdir}"/usr/share/doc/libXvMC/

  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 libXvMC-${pkgver}/COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}
